<script type="text/javascript">
    $(function () {

        $("#cgd_search_grid").edatagrid({
            url: $.webPath() + "/cggl/cgdgl/cgdSearchList?cggsId=" + $("#cggsId").val() + "&sbgsId=" + $("#gsId").val() + "&gysid=" + $("#gysid").val(),
            checkbox: true,
            fitColumns: false,
            singleSelect: false,
            fit: true,
//            width:1100,
//            height:400,
            pagination: true,
            checkOnSelect: false,
            selectOnCheck: true,
            rownumbers: true,
            frozenColumns: [
                [
                    {field: 'checked', checkbox: true},
                    {field: 'cgdh', title: '送货单号', width: 150, align: 'center'},
                    {field: 'fhrq', title: '发货日期', width: 80, align: 'center'},
                    {field: 'gys_qc', title: '供应商名称', width: 150, align: 'center'}
                ]
            ],
            columns: [
                [
                    {field: 'rksl', title: '入库数量', align: 'right',
                        formatter: function (value) {
                            var sl = formatSl(value, ",");
                            return sl;
                        }, width: 100},
                    {field: 'hsj', title: '含税价(元)', width: 100, align: 'right',
                        formatter: function (value) {
                            var sl = formatJe(value, ",");
                            return sl;
                        }},
                    {field: 'sjdj', title: '实际单价(元)', width: 100, align: 'right',
                        formatter: function (value) {
                            var sl = formatJe(value, ",");
                            return sl;
                        }},
                    {field: 'bhsj', title: '不含税价(元)', width: 100, align: 'right',
                        formatter: function (value) {
                            var sl = formatJe(value, ",");
                            return sl;
                        }},
                    {field: 'cggs_jc', title: '采购公司', width: 90, align: 'center'},
                    {field: 'sbgs_jc', title: '申报公司', width: 90, align: 'center'},
                    {field: 'sbbm_qc', title: '申报部门', width: 70, align: 'center'},
                    {field: 'sbr_xm', title: '申报人', width: 50, align: 'center'}
                ]
            ],
            onLoadSuccess: function () {
                $(".datagrid-htable .datagrid-cell").css('text-align', 'center');
            }
        });
        $("#btn_cgd_search_init").click(function () {
            cgd_search_init();
        });

    })
    // 查询采购单
    function cgd_search_init() {
        var fhrqStart = $('#cgd_fhrq_start').datebox('getValue');
        var fhrqEnd = $('#cgd_fhrq_end').datebox('getValue');
        $('#cgd_search_grid').datagrid('load',
                {
                    cgdh: $('#cgd_cgdh').val(),
                    fhrqStart: fhrqStart,
                    fhrqEnd: fhrqEnd
                }
        );
    }

</script>

<input type="hidden" id="gsId" value="${(gsId)!}"/>
<input type="hidden" id="cggsId" value="${(cggsId)!}"/>
<input type="hidden" id="gysid" value="${(gysid)!}"/>
<div id="layout_cgd_search" class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center'">
        <div id="toolbar_cgd_search">
            <div style="height: 8px;">

            </div>
            <div class="textcon">
                <table class="tb">
                    <tr>
                        <th>送货单号：</th>
                        <td><input id="cgd_cgdh" name="cgdh" type="text" class="input-text"></td>
                    </tr>
                    <tr>
                        <th>发货日期：</th>
                        <td><input id="cgd_fhrq_start" type="text" class="easyui-datebox input-text"/></td>
                        <td align="center">至</td>
                        <td><input id="cgd_fhrq_end" type="text" class="easyui-datebox input-text"/></td>
                        <td style=" padding-left:5px;"><input id="btn_cgd_search_init" type="button" value=""
                                                              class="submit"/></td>
                    </tr>
                </table>
            </div>
        </div>
        <table id="cgd_search_grid"></table>
    </div>
</div>